<template>
  <div class="prizepanel" :data="prize.prizetype" >
    <!-- <alert v-model="alert.show" :title="alert.title" >{{ alert.msg}}</alert> -->
    <toast v-model="alert.show" type="text" :time="800" width='2.4rem' is-show-mask :text="alert.title+alert.msg" position="middle"></toast>
    <Loading  :class="{none:!showLoad}"/>
    <div v-transfer-dom>
      <popup v-model="showAddress" position="bottom">
         <x-table>
        <thead>
          <tr>
            <th>营业厅名称</th>
            <th>营业厅地址</th>
          </tr>
        </thead>
        <tbody>
          <tr v-for="(items,key ) of xiaomingAddr" :key="key">
            <td>{{items.name}}</td>
            <td>{{items.address}}</td>
          </tr>
        </tbody>
      </x-table>
        <div style="padding: 15px;">
          <x-button @click.native="showAddress = false" plain type="primary">关闭</x-button>
        </div>
      </popup>
    </div>
    <div class="contianer">
    <!-- 小茗 -->
    <template v-if="prize.prizetype==1">
        <div class="xiaoming">
          <p>请联系附近营业厅客户经理</p>
          <p>输入领取码</p>
          <p><input type="text" v-model="xiaoming.xiaomingCode"></p>
          <p><a href="javascript:void(0);" @click.passive="showAddress=true">查看可领取营业厅</a></p>
        </div>
    </template>
    <!-- 腾讯王卡 -->
    <template v-else-if="prize.prizetype==2">
          <div class="address">
          <p class="input-group"><label for="">姓名：</label><input type="text" v-disabled="readonly"  v-model="wangka.wangkaName" ></p>
          <p class="input-group"><label for="">手机号码：</label><input type="text"  v-disabled="readonly"  v-model="wangka.wangkaPhone" ></p>
          <p class="input-group"><label >收货地址：</label><input type="text"  v-disabled="readonly"  v-model="wangka.wangkaAddress"></p>
          <p class="info">温馨提示：请按照xx省xx市xxxx正确填写收货信息，小沃会尽快将王卡寄送，请耐心等待</p>
        </div>
    </template>
     <!-- vivo旗舰 -->
        <template v-else-if="prize.prizetype==3">
          <div class="address">
          <p class="input-group"><label for="">姓名：</label><input type="text"  v-disabled="readonly" v-model="vivo.vivoName" ></p>
          <p class="input-group"><label for="">手机号码：</label><input type="text"  v-disabled="readonly"  v-model="vivo.vivoPhone"></p>
          <p class="input-group"><label>身份证号：</label><input type="text"  v-disabled="readonly"   v-model="vivo.vivoCardNo"></p>
          <p class="info">我们将在活动结束后的15个工作日内，由江西联通微信公众号官方客服电话联系您，请注意保持电话畅通。</p>
        </div>
    </template>
     <!-- 滴滴出行 -->
    <template v-else-if="prize.prizetype==4">
         <div class="address">
          <!-- <p class="input-group"><label for="">手机号码：</label><input type="text" :readonly="readonly" v-model="bindPhone"></p> -->
          <p class="input-group"></p>
          <p class="info">我们将在7个工作日内下发短信，按照短信提示到流量小程序领取，即可在滴滴出行app中使用。</p>
        </div>
    </template>
     <!-- 腾讯视频 -->
    <template v-else-if="prize.prizetype==5">
        <div class="txtv">
          <p class="input-group"><span>券码：</span><span>{{txvipcard}}</span></p>
          <p class="input-group"></p>
          <p class="info">(长按可复制)</p>
          <p class="input-group"></p>
        </div> 
    </template>
     <!-- 200M -->
    <template v-else-if="prize.prizetype==6">
        <div class="liuliang">
          <p class="input-group"><span class="flow">请选择200M流量生效时间</span></p>
          <p class="btn-group"><span  @click.passive="receivePrize(prize.prizetype,0)"></span><span  @click.passive="receivePrize(prize.prizetype,1)"></span></p>
        </div> 
    </template>
      <!-- vivo50减10的优惠券-->
    <template v-else-if="prize.prizetype==7">
        <div class="liuliang">
          <p class="input-group"><span class="flow">vivo江西线上商城50元减10优惠券</span></p>
          <p class="sub-btn" @click.passive="toQuanma(prize.prizemsg.linkUrl)">领取</p>
        </div> 
    </template>
      <!-- vivo八折优惠券-->
    <template v-else-if="prize.prizetype==8">
        <div class="liuliang">
          <p class="input-group"><span class="flow">vivo江西线上商城8折优惠券</span></p>
          <p class="sub-btn" @click.passive="toQuanma(prize.prizemsg.linkUrl)">领取</p>
        </div> 
    </template>
       <!--腾讯手机回收券-->
    <template v-else-if="prize.prizetype==10">
        <div class="liuliang">
          <p class="input-group"><span class="flow">腾讯手机回收现金券</span></p>
          <p class="sub-btn" @click.passive="toQuanma(prize.prizemsg.linkUrl)">领取</p>
        </div> 
    </template>
       <!-- vivo八折优惠券-->
    <template v-else-if="prize.prizetype==11">
        <div class="liuliang">
          <p class="input-group"><span class="flow">同程艺龙优惠券</span></p>
          <p class="sub-btn" @click.passive="toQuanma(prize.prizemsg.linkUrl)">领取</p>
        </div> 
    </template>
     <p class="sub-btn" v-if="prize.prizetype!=6&&prize.status==0" @click.passive="receivePrize(prize.prizetype)">提交</p>
     <x-icon type="ios-close" size="36" v-if="prize.prizetype!=9" class="icon-red close-panel" @click.passive="closePanel()"></x-icon>
    </div>
  </div>
</template>
<script>
import Qs from "qs";
import { idCardNoUtil, getAge } from '@/assets/lib/identifyCk.js'
import {
  getServerHost,
  preventMove,
  GetRequest,
  checkMobile,
  checkQq
} from "@/assets/lib/tool.js";
import { Alert, Popup, XTable, XButton, Toast, TransferDomDirective as TransferDom } from "vux";
import { setTimeout } from 'timers';
import Loading from "@/components/com/Loading";
export default {
  directives: {
    TransferDom,
    disabled: function (el, binding, vnode) {
      // console.log(el, el.disabled, binding.value);
      el.disabled = binding.value;
    }
  },
  components: {
    Alert, Popup, XTable, XButton, Toast, Loading
  },
  props: {
    prize: {
      type: Object,
      required: true
    }
  },
  data() {
    return {
      showLoad: false,
      openid: GetRequest().openid,
      getWangkaUrl: "/wxjx/goddess/common/prize/getWangka",
      getXiaomingUrl: "/wxjx/goddess/common/prize/getXiaoming",
      getVivoUrl: "/wxjx/goddess/common/prize/getVivo",
      flowRechargeUrl: "/wxjx/goddess/common/prize/flowRecharge",
      bindPhone: "",
      xiaomingAddr:
        [{
          "name": "江西师范高等专科学校营业厅",
          "address": "江西师范高等专科学校7号学生公寓711#"
        },
        {
          "name": "宜春职院自有厅",
          "address": "宜春市袁州区中山西路399号宜春职业技术学院北校区百分超市门口"
        },
        {
          "name": "宜春学院自有营业厅",
          "address": "宜春市袁州区学府路576号宜春学院女生宿舍对面习大厨旁"
        },
        {
          "name": "宜春职业技术学院报刊亭合作厅",
          "address": "宜春市袁州区学府路宜春职业技术学院南校区食堂对面"
        },
        {
          "name": "农业工程学院合作厅",
          "address": "樟树市四特大道266号江西农业工程职业学院内食堂旁"
        },
        {
          "name": "新余学院光伏路合作厅",
          "address": "新余学院校内一食堂旁边"
        },
        {
          "name": "赣西学院合作厅",
          "address": "赣西学院校内行政楼负一楼"
        },
        {
          "name": "工程学院顶峰合作厅",
          "address": "江西工程学院三校东门斜对面"
        },
        {
          "name": "新余学院新校合作厅",
          "address": "新余学院东门公交站台对面"
        },
        {
          "name": "江西工程学院三校合作厅",
          "address": "江西工程学院三校区中心食堂旁边"
        },
        {
          "name": "太阳能科技职业学院合作厅",
          "address": "太阳能学院校内大门右侧"
        },
        {
          "name": "司法警校合作厅",
          "address": "赣西学院司法校区食堂旁边"
        },
        {
          "name": "冶金职业技术学院河下合作厅",
          "address": "河下镇冶金学院北门斜对面"
        },
        {
          "name": "冶金学院中心超市合作厅",
          "address": "冶金学院新老校区中间"
        },
        {
          "name": "渝水区劳动北路雅皓科技店",
          "address": "新余劳动北路融城大酒店西面"
        },
        {
          "name": "上饶市职业技术学院合作厅",
          "address": "上饶县旭日大道358号职业技术学院门口OPPO手机店"
        },
        {
          "name": "信州区师范学院合作厅",
          "address": "上饶师范学院13栋楼下"
        },
        {
          "name": "上饶市信州区医学院合作厅",
          "address": "医学院学生宿舍1楼"
        },
        {
          "name": "信州区师范学校合作厅",
          "address": "上饶师范学校艺术楼1楼"
        },
        {
          "name": "萍乡市卫生学校强鑫合作厅",
          "address": "卫校校内7.8栋宿舍楼下"
        },
        {
          "name": "萍乡学院合作厅",
          "address": "萍乡学院校内二食堂对面"
        },
        {
          "name": "江西工业工程职业技术学院合作厅",
          "address": "工业工程学院院内0栋旁边"
        },
        {
          "name": "江西应用工程职业学院合作厅",
          "address": "应用工程学院院超市内"
        },
        {
          "name": "东华理工枫林自有厅",
          "address": "江西省南昌市经济技术开发区枫林大道东华理工大学枫林校区"
        },
        {
          "name": "泰豪动漫学院自有厅",
          "address": "南昌县小蓝工业园金沙二路1888号民德楼一楼6#店面"
        },
        {
          "name": "华东交大南区自有厅",
          "address": "江西省南昌市经济技术开发区双港东大街808号华东交通大学南区飞扬路"
        },
        {
          "name": "师大爱心自有厅",
          "address": "江西师范大学图书馆西二门1楼"
        },
        {
          "name": "南昌师范学院自有厅",
          "address": "江西省南昌市新建县经开区瑞香路889号南昌师范学院昌008号"
        },
        {
          "name": "江科7栋自有厅",
          "address": "江西科技学院7栋宿舍（井冈山餐厅旁）"
        },
        {
          "name": "红角洲南大自有营业厅",
          "address": "学府大道999号校内商业街（休闲广场入口）"
        },
        {
          "name": "师大自有厅",
          "address": "江西师范大学二食堂"
        },
        {
          "name": "财经大学爱心自有厅",
          "address": "江西省南昌市经济技术开发区双港东大街169号财大北区"
        },
        {
          "name": "现代学院自有厅",
          "address": "江西现代职业技术学院食堂旁"
        },
        {
          "name": "财大麦庐自有厅",
          "address": "江西省南昌市经济技术开发区玉屏西大街665号"
        },
        {
          "name": "蓝天沃自有厅",
          "address": "江西科技学院9栋宿舍"
        },
        {
          "name": "赣江大学自有厅",
          "address": "南昌市新建区创业南路998号新商业街1号"
        },
        {
          "name": "红角洲科大自有营业厅",
          "address": "学府大道598号校内科乐广场一楼02"
        },
        {
          "name": "农大自有厅",
          "address": "江西省南昌市经济技术开发区志敏大道1225号江西农业大学北区"
        },
        {
          "name": "南昌理工学院自有厅",
          "address": "江西省南昌市经济技术开发区英雄大道901号"
        },
        {
          "name": "昌北区新机电合作厅",
          "address": "江西省南昌市经济技术开发区枫林东大街江西机电职业技术学院"
        },
        {
          "name": "昌北江西理工合作厅",
          "address": "江西省南昌市经济技术开发区双港东大街1180号"
        },
        {
          "name": "昌北区江西水校合作厅",
          "address": "江西省南昌市经济技术开发区北山路99号"
        },
        {
          "name": "昌北区正元合作营业厅",
          "address": "江西省南昌市经济技术开发区榴云路于枫林大街交汇口"
        },
        {
          "name": "昌北区新东华理工合作厅",
          "address": "江西省南昌市经济技术开发区广兰大道418号"
        },
        {
          "name": "昌北区司法警官学院合作厅",
          "address": "江西省南昌市经济技术开发区长青路76号"
        },
        {
          "name": "昌北科技师范合作营业厅",
          "address": "江西省南昌市经济技术开发区枫林大街605号"
        },
        {
          "name": "昌北双港路华东交通大学合作厅",
          "address": "江西省南昌市经济技术开发区双港东大街806号华东交通大学北区"
        },
        {
          "name": "红角洲南航商业街合作厅",
          "address": "丰和南大道696号校内商业街3号"
        },
        {
          "name": "红角洲新工贸体验店",
          "address": "嘉言路699号校内商业街中间"
        },
        {
          "name": "青山湖区南大慧院合作厅",
          "address": "北京东路339号惠菀校内6栋宿舍下"
        },
        {
          "name": "红角洲南大手机卖场",
          "address": "学府大道999号校内商业街（休闲广场入口）"
        },
        {
          "name": "红角洲南大体验店",
          "address": "学府大道999号校内23栋宿舍楼下（天健园）"
        },
        {
          "name": "红角洲南航体验店",
          "address": "丰和南大道696号校内商业街33号"
        },
        {
          "name": "新建区旅游商贸学校龙潭合作厅",
          "address": "南昌市新建区丁香路龙潭村商业街"
        },
        {
          "name": "新建区江西省商务学校合作厅",
          "address": "南昌市新建区望城镇新城大道1888号3栋宿舍楼楼下"
        },
        {
          "name": "新建区旅游商贸一食堂大盛合作厅",
          "address": "南昌市新建区丁香路1号校内一食堂内"
        },
        {
          "name": "新建区华东交大学校辉创合作厅",
          "address": "南昌市经济技术开发区黄家湖东路111号新校区商业街"
        },
        {
          "name": "新建区陆军学院文轩合作厅",
          "address": "南昌市新建区长征西路2001号校内观礼台下"
        },
        {
          "name": "新建区南昌工学院合作厅",
          "address": "南昌市新建区创业南路998号老商业街39号"
        },
        {
          "name": "湾里区大宇后街合作厅",
          "address": "南昌市湾里区联富大道001号校内商业街"
        },
        {
          "name": "南昌市湾里区师范专科学院合作厅",
          "address": "南昌市湾里区梅岭大道豫章师范学院商业街"
        },
        {
          "name": "南昌市湾里区中医学院合作厅",
          "address": "南昌市湾里区兴弯大道818号中医药大学商场东门"
        },
        {
          "name": "瑶湖一区子豪通讯合作厅",
          "address": "瑶湖长胜大市场黄家村"
        },
        {
          "name": "瑶湖一区化工合作厅",
          "address": "江西省化学工业高级技工学校"
        },
        {
          "name": "瑶湖一区长胜创游合作厅",
          "address": "瑶湖长胜大市场"
        },
        {
          "name": "瑶湖二区江西工业学院合作厅",
          "address": "江西工业职业技术学院瑶湖校区食堂1楼"
        },
        {
          "name": "瑶湖二区工程学院合作厅",
          "address": "南昌工程学院宿舍一栋架空层"
        },
        {
          "name": "瑶湖二区中新合作厅",
          "address": "南昌市高新开发区创业路925号（江西省电子信息工程学校）"
        },
        {
          "name": "瑶湖一区蓝天学院老校区合作厅",
          "address": "瑶湖尤氨路长胜大市场大门斜对面"
        },
        {
          "name": "瑶湖二区外贸合作厅",
          "address": "江西外语外贸职业学院4栋宿舍"
        },
        {
          "name": "瑶湖二区师大合作厅",
          "address": "江西师范大学科学技术学院1栋学生公寓1楼"
        },
        {
          "name": "瑶湖一区制造合作厅",
          "address": "江西制造职业技术学院医务室隔壁2楼"
        },
        {
          "name": "南昌县江西护理学院合作厅",
          "address": "南昌县小蓝工业园汇仁大道999号校内5#公寓下"
        },
        {
          "name": "南昌县生物学院佟莹合作营业厅",
          "address": "生物学院校内足球场旁3号公寓后面第一个店面"
        },
        {
          "name": "南昌县向塘镇邬君指定专营店",
          "address": "江西科技职业学院对面梨园小区商业区世纪华联斜对面"
        },
        {
          "name": "南昌县象湖新城合作厅",
          "address": "江西工商学院格力电器隔壁"
        },
        {
          "name": "九江市财校章懿骎合作厅",
          "address": "浔阳区青年路96号江西财经职业学院内东3号"
        },
        {
          "name": "九江市鑫达通讯合作厅",
          "address": "浔阳区湖滨小区青年路78-7号"
        },
        {
          "name": "濂溪区花园畈中国联通合作厅",
          "address": "濂溪区十里大道1188号船校小门正对面"
        },
        {
          "name": "九江职业技术学院第三产业合作厅",
          "address": "濂溪区十里校区内6栋楼下"
        },
        {
          "name": "九江市庐山区九江学院联通手机店",
          "address": "濂溪区十里大道前进东路666号联通营业厅(九江学院对面洪兴大药房旁边）"
        },
        {
          "name": "浔阳区校园联通手机店",
          "address": "九江学院内第四服务二楼联通营业厅"
        },
        {
          "name": "九江市职业大学刘旦代理店",
          "address": "濂溪区新职大内商业街c2楼c07"
        },
        {
          "name": "九江市共青城市大鑫联通营业厅",
          "address": "南昌大学内后勤处"
        },
        {
          "name": "九江市共青城科技学院合作厅",
          "address": "共青科技学院内教师公寓2栋"
        },
        {
          "name": "南航营业厅",
          "address": "南航学院内学生公寓6栋"
        },
        {
          "name": "九江市共青城南湖大道自有厅",
          "address": "南湖大道46-47号联通自有厅"
        },
        {
          "name": "镇市城东区陶瓷工艺美院合作厅",
          "address": "景德镇市珠山区新厂西路486号校内大礼堂正门入口北侧"
        },
        {
          "name": "镇市城东区陶瓷学院科技艺术学院合作厅",
          "address": "景德镇市珠山区陶阳南路27号校内大食堂旁"
        },
        {
          "name": "镇市浮梁县陶瓷学院新校区合作厅",
          "address": "景德镇市浮梁县湘湖镇湘湖村1号第二食堂超市入口处"
        },
        {
          "name": "镇市城西区景德镇学院合作厅",
          "address": "景德镇市昌江区瓷都大道838号校内篮球场旁"
        },
        {
          "name": "吉安市青原区学苑路井冈山大学合作营业厅",
          "address": "吉安市青原区井冈山大学北区33栋宿舍楼下联通营业厅"
        },
        {
          "name": "青原区井冈山大学大众联通合作厅",
          "address": "吉安市青原区井冈山大学第三食堂对面联通营业厅"
        },
        {
          "name": "吉安职业技术学院合作厅",
          "address": "吉安市吉州区职业技术学院行政楼一楼联通营业厅"
        },
        {
          "name": "章贡区水晶宫通信经营部理工大学合作厅",
          "address": "红旗大道86号江西理工大学校门口左侧"
        },
        {
          "name": "黄金区环境工程学院合作厅",
          "address": " 江西环境工程职业学院校卫队旁边"
        },
        {
          "name": "黄金区应用技术学院体验店",
          "address": "黄金区江西应用技术职业学院校内理发店旁"
        },
        {
          "name": "黄金区理工应科院体验店",
          "address": "江西理工应用科学学院馨香园食堂旁边"
        },
        {
          "name": "黄金区理工西区合作厅",
          "address": "宋城路83号江西理工大学西区4栋宿舍楼下"
        },
        {
          "name": "黄金区赣南医学院体验店",
          "address": "黄金区高校区医学院生活区第三间店铺"
        },
        {
          "name": "黄金区师院黄金校区体验店",
          "address": "赣南师大北院定福超市下面，服务楼7号店铺"
        },
        {
          "name": "黄金区卫生学校体验店",
          "address": "黄金区高校区卫校内一栋宿舍楼下"
        },
        {
          "name": "黄金区新越讯合作厅",
          "address": "章贡区西郊路1号"
        },
        {
          "name": "赣南师范大学科技学院营业厅",
          "address": "红旗大道科技师大篮球操场旁"
        },
        {
          "name": "赣南师范高等专科学校营业厅",
          "address": "高校区赣南师范高等专科学校校内5栋宿舍楼下"
        },
        {
          "name": "抚州中医学校新区周国根合作店",
          "address": "抚州市中医学校新区1栋宿舍楼下"
        },
        {
          "name": "抚州中医学校邹志林合作店",
          "address": "中医学校老区篮球场对面"
        },
        {
          "name": "抚州东华理工本部朱荣昌合作店",
          "address": "东华理工本部羽毛球馆南侧第一间店铺"
        },
        {
          "name": "抚州职业技术学院邓斌合作店",
          "address": "抚州职业技术学院商业中心A4店铺"
        },
        {
          "name": "抚州东华理工北区过艳丽合作店",
          "address": "东华理工北区原锅炉旁西边第二间店铺"
        },
        {
          "name": "南昌大学朱荣昌合作店",
          "address": "南大商纵楼A座一楼15号店面"
        }],
      txvipcard: "",
      showAddress: false,
      readonly: false,
      prizeInfo: this.prize,
      alert: {
        show: false,
        title: "",
        msg: ""
      },
      //领取流量
      flow: {
        openid: GetRequest().openid,
        type: 0, //0立即,1次月
        userPrizeId: ''
      },
      //小茗同学
      xiaoming: {
        openid: GetRequest().openid,
        userPrizeId: '',
        xiaomingCode: ""
      },
      // 腾旭王卡
      wangka: {
        openid: GetRequest().openid,
        userPrizeId: '',
        wangkaName: "",
        wangkaPhone: "",
        wangkaAddress: ""
      },
      //vivo奖品
      vivo: {
        openid: GetRequest().openid,
        userPrizeId: '',
        vivoName: "",
        vivoPhone: "",
        vivoCardNo: ""
      }
    };
  },
  watch: {
    prizeInfo(curVal, oldVal) {
      if (curVal) {
        return curVal;
      }
    },
    prize(curVal, oldVal) {
      if (curVal) {
        this.initInfo();
        return curVal;
      }
    }
  },
  mounted() {
    this.$nextTick(() => {
      this.initInfo();
      // this.getXiaomingAddr();
    });
  },
  methods: {
    //获取小茗同学地址领取位置
    getXiaomingAddr() {
      this.$http('./static/json/xiaoming.json', {
      }).then(result => {
        //console.log(result.data);
        // result = JSON.parse(result.data);
        this.xiaomingAddr = result.data;
      })
    },
    //获取填写的信息
    initInfo() {
      //console.log(this.prize.prizemsg);
      //console.log('ok', Number(this.prize.prizemsg.prizeId));
      if (0 === this.prize.prizemsg.status) {
        this.readonly = false;
      } else {
        this.readonly = true;
      }
      switch (Number(this.prize.prizemsg.prizeId)) {
        case 1:

          this.xiaoming.xiaomingCode = this.prize.prizemsg["xiaomingCode"];
          break;
        case 2:
          //console.log('ok');

          this.wangka.wangkaName = this.prize.prizemsg['wangkaName'],
            this.wangka.wangkaPhone = this.prize.prizemsg['wangkaPhone'],
            this.wangka.wangkaAddress = this.prize.prizemsg['wangkaAddress']
          break;
        case 3:

          this.vivo.vivoName = this.prize.prizemsg['vivoName'],
            this.vivo.vivoPhone = this.prize.prizemsg['vivoPhone'],
            this.vivo.vivoCardNo = this.prize.prizemsg['vivoCardNo']
          break;
        case 4:
          break;
        case 5:

          this.txvipcard = this.prize.prizemsg['tencentVipCode']
          break;
        case 6:
          break;
        case 7:
          break;
        case 8:
          break;
      }

    },
    closePanel() {
      this.$emit("closepanel", true);
    },
    //跳转到优惠券页面
    toQuanma(url) {
      location.href = url;
    },
    //检测填写信息
    judgeInfo(data) {
      var vm = this;
      let flag = 0;
      for (let name in data) {
        data[name] = data[name] || "";
        //console.log("boolean", data[name]);
        if (!Boolean(data[name])) {

          flag = 1;
          return flag;
        }
      }
      return flag;
    },
    //根据提交的信息显示
    //领取奖品
    receivePrize(type, flowtype) {
      flowtype = flowtype || 0;
      // //console.log('type',type);
      // //console.log('flowtype',flowtype);
      var vm = this;
      //console.log("vm.prize.status", type);
      var prize = {
        url: "",
        data: ""
      };
      vm.readonly = false;
      switch (type) {
        case 1:
          vm.xiaoming.userPrizeId = Number(this.prize.prizemsg.id);
          prize = {
            url: vm.getXiaomingUrl,
            data: vm.xiaoming
          };
          if (vm.judgeInfo(prize.data)) {
            vm.alert = {
              show: true,
              title: "",
              msg: "请填写完信息"
            };
            return;
          }
          break;
        case 2:
          vm.wangka.userPrizeId = Number(this.prize.prizemsg.id);
          prize = {
            url: vm.getWangkaUrl,
            data: vm.wangka
          };
          //console.log(prize.data);

          if (vm.judgeInfo(prize.data)) {
            vm.alert = {
              show: true,
              title: "",
              msg: "请填写完信息"
            };
            return;
          }
          if (!checkMobile(vm.wangka.wangkaPhone)) {
            vm.alert = {
              show: true,
              title: "",
              msg: "请填写完整手机号"
            };
            return;
          }
          break;
        case 3:
          vm.vivo.userPrizeId = Number(this.prize.prizemsg.id);
          prize = {
            url: vm.getVivoUrl,
            data: vm.vivo
          };
          if (vm.judgeInfo(prize.data)) {
            vm.alert = {
              show: true,
              title: "",
              msg: "请填写完信息"
            };
            return;
          }
          if (!checkMobile(vm.vivo.vivoPhone)) {
            vm.alert = {
              show: true,
              title: "",
              msg: "请填写完整手机号"
            };
            return;
          }
          if (!idCardNoUtil.checkIdCardNo(vm.vivo.vivoCardNo)) {
            vm.alert = {
              show: true,
              title: "",
              msg: "请填写正确身份证信息"
            };
            return;
          }
          break;
        case 4:
          // 滴滴出行 直接显示绑定手机号
          break;
        case 5:
          break;
        case 6:
          vm.flow.type = flowtype;
          vm.flow.userPrizeId = Number(this.prize.prizemsg.id);
          prize = {
            url: vm.flowRechargeUrl,
            data: vm.flow
          };
          break;
        case 7:
          break;
        case 8:
          break;
      }

      vm.showLoad = true;
      console.log(prize);
      this.$http(getServerHost() + prize.url, {
        params: prize.data
      }).then(result => {
        result = result.data;
        vm.showLoad = false;
        if ("200" == result.code) {
          //关闭弹窗
          vm.alert = {
            show: true,
            title: "",
            msg: result.msg
          };
          setTimeout(() => {
            vm.closePanel();
            location.reload();
          }, 1000)
        } else if ("999" == result.code) {
          vm.alert = {
            show: true,
            title: "",
            msg: result.msg
          };
          setTimeout(() => {
            vm.closePanel();
            location.reload();
          }, 1000)
        }
        // //console.log(result);
      });
    }
  }
};
</script>
<style lang="less" scoped>
.none {
  display: none;
}

.prizepanel {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  background: rgba(0, 0, 0, 0.1);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-tap-highlight-color: transparent;
  .contianer {
    position: relative;
    top: 15%;
    width: 563px;
    min-height: 358px;
    padding: 40px;
    margin: 0 auto;
    background: url("../../assets/img/panel.png") no-repeat;
    background-size: 100% 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    .xiaoming {
      color: #444444;
      p {
        padding: 15px 0;
        input {
          height: 34px;
        }
        a {
          text-decoration: underline;
        }
      }
    }
    .address {
      padding: 20px 0;
      .input-group {
        padding: 10px 0;
        display: flex;
        label {
          width: 30%;
        }
        input {
          width: 70%;
          height: 40px;
        }
      }
      .info {
        line-height: 1.5em;
        color: #ff354f;
      }
    }
    .txtv {
      .input-group {
        padding: 10px 0;
        text-align: center;
      }
    }
    .liuliang {
      .input-group {
        padding: 60px 0;
        .flow {
          font-size: 30px;
          font-weight: bold;
        }
      }
      .btn-group {
        display: flex;
        justify-content: space-around;
        span:nth-child(1) {
          width: 194px;
          height: 57px;
          background: url("../../assets/img/rec-btns.png") no-repeat;
          background-size: 426px 57px;
        }
        span:nth-child(2) {
          width: 194px;
          height: 57px;
          background: url("../../assets/img/rec-btns.png") no-repeat -228px 0;
          background-size: 426px 57px;
        }
      }
    }
    .sub-btn {
      margin: 0 auto;
      width: 198px;
      height: 52px;
      font-weight: bold;
      line-height: 52px;
      border-radius: 0.05rem;
      background: #ffbd0f;
    }
    .close-panel {
      align-self: center;
      position: relative;
      top: 180px;
    }
  }
}
</style>
